﻿using System;
using System.Windows.Forms;

namespace QLCF.Forms
{
    public partial class popupProductSetQuantity : Form
    {
        public frmProduct frmTbS1 = null;
        public int productID;
        public int m_quantity;        
        public string m_name = string.Empty;
        public string m_unit = string.Empty;
        public popupProductSetQuantity(frmProduct Parrent)
        {
            InitializeComponent();
            frmTbS1 = Parrent;
        }

        public popupProductSetQuantity(frmProduct m_frmTableService, int m_productID, string pName, string unit, double quantity)
        {
            InitializeComponent();
            frmTbS1 = m_frmTableService;
            productID = m_productID;
            lblProductName.Text = pName;
            lblUnit.Text = unit;
            numQuantity.Value = Convert.ToDecimal(quantity);
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            frmTbS1.updateQuantity(productID, Convert.ToDouble(numQuantity.Value));
            this.Close();
        }
    }
}
